package Chapter7_MultiplexingClass;

/**
 * Date: 2019/2/18
 * Time: 17:58
 * User: Driss.
 */
public class SpaceShipDelegation {
    private String name;
    private SpaceShipControls controls = new SpaceShipControls();
    public SpaceShipDelegation(String name){
        this.name = name;
    }

    //Delegated mehods:
    public void back(int velocity){
        controls.back(velocity);
    }

    public void down(int velocity){
        controls.back(velocity);
    }

    public void forward(int velocity){
        controls.forward(velocity);
    }

    public void left(int velocity){
        controls.left(velocity);
    }

    public void right(int velocity){
        controls.right(velocity);
    }

    public void turboBoost(int velocity){
        controls.turboBoost();
    }

    public void up(int velocity){
        controls.up(velocity);
    }

    public static void main(String[] args) {
        SpaceShipDelegation protector = new SpaceShipDelegation("NESA Protector");
        protector.forward(100);
    }

}
